import ar.com.coonocer.joy.mdg.templatehelpers.AssociationUtil;
import ar.com.coonocer.joy.mdg.templatehelpers.AttributeUtil;
import ar.com.coonocer.joy.mdg.templatehelpers.StereotypeUtil;
import ar.com.coonocer.joy.mdg.xmi.core.Attribute;
import ar.com.coonocer.joy.mdg.xmi.core.Class
import ar.com.coonocer.joy.mdg.xmi.model.Model;
import ar.com.coonocer.joy.mdg.xmi.model.Package

public class AbstractTypeHelper{

	public static  String getTypeForDBType(Class clazz, Attribute attribute){
		String dbTypeName = attribute.type?.name;
		String typeName = "String";
		//
		if (dbTypeName!=null){
			if (dbTypeName.equals("BFILE") || dbTypeName.equals("BLOB") || dbTypeName.equals("LONG") ||
			dbTypeName.equals("LONG RAW") || dbTypeName.equals("RAW") ||dbTypeName.equals("ROWID")){
				typeName="Binary";
			} else if (dbTypeName.equals("CHAR") || dbTypeName.equals("NCHAR") ||
			dbTypeName.equals("NVARCHAR") ||dbTypeName.equals("NVARCHAR2") ||
			dbTypeName.equals("CLOB") || dbTypeName.equals("NCLOB") ||
			dbTypeName.equals("VARCHAR") || dbTypeName.equals("VARCHAR2")) {
				typeName="String";
			} else if (dbTypeName.equals("DATE")) {
				typeName="Date";
			} else if (dbTypeName.equals("FLOAT") || dbTypeName.equals("NUMBER")) {
				typeName="Number";
			}
		}
		//
		return typeName;
	}
}